package com.tally.server.dto;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

public class EcodeDTO {

    /**
     * id
     */
    private String id;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 邮箱验证码
     */
    private String code;

    /**
     * 用途|枚举[EcodeUseEnum]: REGISTER("R","注册"), FORGET("F","忘记密码")
     */
    private String use;

    /**
     * 生成时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createAt;

    /**
     * 状态|枚举[EcodeStatusEnum]: USED("U","已使用"), NOT_USED("N","未使用")
     */
    private String status;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUse() {
        return use;
    }

    public void setUse(String use) {
        this.use = use;
    }

    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", email=").append(email);
        sb.append(", code=").append(code);
        sb.append(", use=").append(use);
        sb.append(", createAt=").append(createAt);
        sb.append(", status=").append(status);
        sb.append("]");
        return sb.toString();
    }

}